package main

import (
	"flag"
	"fmt"
)

/*
	parse os.Args
		func Int(name string, value int, usage string) *int
		func IntVar(p *int, name string, value int, usage string)
		...

*/
func main() {
	user := flag.String("u", "", "user name")
	passwd := flag.String("pwd", "", "password")
	port := flag.Int("p", 3306, "mysql port")

	var host string
	flag.StringVar(&host, "h", "", "host name")

	flag.Parse()
	// go run stringTest.go -u root -pwd 123455 -p 2210 -h 192.168.1.1
	// root 123455 2210 192.168.1.1
	fmt.Println(*user, *passwd, *port, host)
}
